package com.bluse.task;

import com.bluse.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


//@Component
public class SaveUserTask {

    private static final Logger logger = LoggerFactory.getLogger(SaveUserTask.class);

    @Autowired
    private UserService userService;

    @Scheduled(fixedRate = 2000)
    public void work() {
        logger.info("User list is:{}", userService.findAll().toString());
    }

}
